Skip to content

Split test_utils.hpp into focused headers#4164

Draft
atobiszei wants to merge 5 commits intoatobisze_build2_p1from
atobisze_build3
Draft

Split test_utils.hpp into focused headers#4164
atobiszei wants to merge 5 commits intoatobisze_build2_p1from
atobisze_build3

Conversation

@atobiszei
Copy link
Copy Markdown
Collaborator

No description provided.

Extract from monolithic test_utils.hpp (849 lines) into:
- test_request_utils_tfs.hpp/.cpp: TFS request helpers
- test_request_utils_kfs.hpp/.cpp: KFS request helpers
- test_request_utils_capi.hpp/.cpp: CAPI request helpers
- test_server_utils.hpp/.cpp: Server start/stop, port randomization
- test_model_manager_utils.hpp/.cpp: waitForOVMSConfigReload
- test_predict_validation_utils.hpp: MockedMetadataModelIns
- test_config_utils.hpp: ConstructorEnabledConfig
- test_mediapipe_utils.hpp: DummyMediapipeGraphDefinition

Backward-compat re-exports in test_utils.hpp preserved.
Removed dead code: waitForOVMSResourcesCleanup (zero callers).
All files folded into test_utils cc_library (no circular deps).
Build + 235 tests pass (--config=mp_on_py_on).
@atobiszei atobiszei added the WIP Do not merge until resolved label Apr 27, 2026
Update ~50 consumer files to use direct includes of split headers.
Remove all backward-compat re-exports from test_utils.hpp.
Fix transitive dependency breakages:
- Add missing gmock includes (c_api_tests, kfs_metadata_test)
- Add missing modelinstance.hpp (mediapipeflow_test)
- Add missing modelmanager.hpp (stress_test_utils, embeddingsnode_test)
- Add missing anonymous_input_name.hpp (modelconfig_test)
- Add missing <future> (c_api_test_utils.hpp)
- Add missing kfs includes (model_service_test, kfs_metadata_test)
- Remove dead using namespace tensorflow (pipelinedefinitionstatus_test)
Build + 293 tests pass (--config=mp_on_py_on).
… remove unused test_utils.hpp, split 17 test libs

- Add ovms_cc_test and ovms_test_cc_library macros to common_settings.bzl
  (defaults: linkstatic=1, alwayslink=True, COMMON_STATIC_TEST_COPTS, gtest)
- Move COPTS_CLOUD to common_settings.bzl (shared across BUILD files)
- Fix ~58 test files: src/test/test_* -> test_* relative include paths
- Remove unnecessary test_utils.hpp from ~38 files
- Make test_models.hpp self-contained (add filesystem, shape, modelversion)
- Split 17 test .cpp files into ovms_test_cc_library targets with minimal deps:
  stringutils, threadsafequeue, tensorinfo, layout, tensorutils,
  custom_node_buffersqueue, model_version_policy, kfs_rest_parser,
  rerank_chunking, rerank_handler, metrics, custom_node_output_allocator,
  systeminfo, localfilesystem, gcsfilesystem, azurefilesystem, schema
- shape_test: minimal deps (libovmsshape, openvino)
- ovinferrequestqueue_test: deps (ovinferrequestsqueue, timer, openvino)
- modelconfig_test: deps (modelconfig, anonymous_input_name, status, platform_utils, openvino)
- ovmsconfig_test: deps (config, server_settings, exit_codes, systeminfo, env_guard, filesystem, spdlog)
- pipelinedefinitionstatus_test: deps (pipelinedefinitionstatus, status, timer)
  - Removed unused includes (modelinstance.hpp, prediction_service_utils.hpp)
- ov_utils_test: deps (ov_utils, modelinstance, filesystem, test_utils, openvino)

Also extracted test_config_utils as header-only cc_library target.
Added test_config_utils dep to pull_hf_model_test (was getting it transitively from test_utils before).

All 180 filtered tests pass.
The file was accidentally converted from CRLF to LF in Phase 3,
causing GitHub to show every line as changed. Restored original
CRLF endings so only the actual include addition is visible.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

WIP Do not merge until resolved

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant